package game.tileMap.model.vo {
	
	/**
	 * @author GUNDAM
	 */
	public class Skill extends UsableItem {
		public var mp_cost:Number;
		public var hit:Number;
		public var message1 :String,message2:String; 
		
		public function Skill(skillData:XML) {
			super();
			init(skillData);
		}
		private function init(skillData:XML):void{
			id=skillData.id;
			name = skillData.name;
	      	icon_index = skillData.icon_index;
	     	description = skillData.description;
	      	note = skillData.note;
	      	
	      	scope = skillData.scope
		    occasion = 0
		    speed = 0
		    animation_id = skillData.animation_id
		    common_event_id = 0
		    base_damage =  skillData.base_damage
		    variance = 20
		    atk_f = skillData.atk_f;
		    spi_f = skillData.spi_f;
		    physical_attack = false
		    damage_to_mp = false
		    absorb_damage = false
		    ignore_defense = false
			      	
		    mp_cost = skillData.mp_cost;
		    hit = 100;
		    message1 = ""
		    message2 = ""
			
			element_set = splitToArray(skillData.element_set);
			plus_state_set=splitToArray(skillData.plus_state_set);
			minus_state_set=splitToArray(skillData.minus_state_set);
		}
		
		private function splitToArray(str:String):Array{
			var arr:Array=[];
			if (str){
				var tempArr:Array=str.split(",");
				for each(var id:int in tempArr){
					arr.push(id);
				}
			}
			
			return arr;
		}
	}
}
